package com.qfedu.spring.mybatis.service.impl;

import com.qfedu.spring.mybatis.entity.User;
import com.qfedu.spring.mybatis.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

import static org.junit.jupiter.api.Assertions.*;

/**
 * @author zhang
 * @Title: commonValidateAdd
 * @date : 2022/4/27 16:47
 */
class UserServiceImplTest1 {

    @Test
    void login() {
    }

    @Test
    void selectAll() {
        ApplicationContext context = new ClassPathXmlApplicationContext("/spring-context.xml");
        UserService userService = (UserService) context.getBean("userService");
        List<User> users = userService.selectAll();
//        users.forEach(x -> System.out.println(users));
//        users.forEach(System.out::println);

        for (User user : users) {
            System.out.println("user = " + user);
        }

    }
}